<template>
  <div class="container">
    <div class="nav">
      <!-- 如果是/user的话，就隐藏van-nav-bar -->
        <van-nav-bar v-show="$route.path!=='/user'" fixed title="黑马头条" right-text="搜索"  @click-right="hRearch" />
    </div>
    <router-view></router-view>
  <van-tabbar route >
      <van-tabbar-item icon="home-o" to='/'>主页</van-tabbar-item>
      <van-tabbar-item icon="search" to='/question'>问题</van-tabbar-item>
      <van-tabbar-item icon="friends-o" to='/video'>视频</van-tabbar-item>
      <van-tabbar-item icon="setting-o" to='/user'>我的</van-tabbar-item>
  </van-tabbar>

  </div>
</template>

<script>
export default {
  methods: {
    hRearch () {
      // 跳到搜索页
      this.$router.push('/search')
    }
  }
}
</script>

<style scoped lang='less'>

</style>
